﻿<%@ Control Language="C#" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="Buffalo.Lib.Common" %>
<%@ Import Namespace="Buffalo.SMECommon.DAL.Models" %>
<%@ Import Namespace="Buffalo.SMECommon.DAL" %>
<%@ Import Namespace="Buffalo.Web.Areas.SMECommon" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            string IDEmployee = Util.ToSafeString(ViewData["IDEmployee"]);
            Employee employee = new EmployeeDAL().GetEmployee(IDEmployee);
            if (!IDEmployee.Equals("0") && !string.IsNullOrEmpty(IDEmployee))
            {
                cboMaritalStatus.SetValue(employee.MaritalStatus);
            }
        }
    }
</script>
<ext:FormPanel ID="EmployeeInfoForm" runat="server" Border="false" Url="/Employee/SaveEmployeeInfo/"
    LabelWidth="135">
    <Items>
        <ext:Container ID="EmployeeInfoFormContainer" runat="server" Flex="1" Layout="Column"
            Height="600">
            <Items>
                <ext:Container ID="Container1" runat="server" Layout="Form" ColumnWidth=".5">
                    <Items>
                        <ext:TextField ID="Code" runat="server" FieldLabel="Code" Width="300" />
                        <ext:TextField ID="FirstName" runat="server" FieldLabel="FirstName" Width="300" />
                        <ext:Hidden ID="MaritalStatus" runat="server" />
                        <ext:SelectBox ID="cboMaritalStatus" runat="server" FieldLabel="MaritalStatus" Width="300">
                            <Items>
                                <ext:ListItem Text="Single" Value="1" />
                                <ext:ListItem Text="Married" Value="2" />
                            </Items>
                            <Listeners>
                                <Select Handler="#{MaritalStatus}.setValue(#{cboMaritalStatus}.getValue());" />
                            </Listeners>
                        </ext:SelectBox>
                    </Items>
                </ext:Container>
                <ext:Container ID="Container2" runat="server" Layout="Form" ColumnWidth=".5">
                    <Items>
                    </Items>
                </ext:Container>
            </Items>
        </ext:Container>
    </Items>
    <BaseParams>
        <ext:Parameter Name="IDEmployee" Value='<%# ViewData["IDEmployee"] %>' Mode="Value" AutoDataBind="true" />
    </BaseParams>
</ext:FormPanel>
